package org.sith.taskrunner.api.toolkit;

import org.sith.taskrunner.api.transformer.InputDataTransofrmer;
import org.sith.taskrunner.api.transformer.ResultTransformer;
import org.sith.taskrunner.api.task.Task;
import org.sith.taskrunner.api.TaskToolkitDescription;

/**
 * @param <T> task
 * @param <I> input data transformer
 * @param <R> result transformer
 * @param <D> toolkit description
 */
public abstract class DefaultTaskToolkit<T extends Task, I extends InputDataTransofrmer, R extends ResultTransformer, D extends TaskToolkitDescription> implements TaskToolkit<T, I, R, D> {

    private I inputDataTransofrmer;
    private R resultTransformer;
    private D toolkitDescription;


    protected DefaultTaskToolkit() {
        inputDataTransofrmer = createInputDataTransofrmer();
        resultTransformer = createResultTransformer();
        toolkitDescription = createToolkitDescription();
    }


    /**
     * @see org.sith.taskrunner.api.toolkit.TaskToolkit
     */
    @Override
    public I getInputDataTransofrmer() {
        return inputDataTransofrmer;
    }

    /**
     * @see org.sith.taskrunner.api.toolkit.TaskToolkit
     */
    @Override
    public R getResultTransformer() {
        return resultTransformer;
    }

    /**
     * @see org.sith.taskrunner.api.toolkit.TaskToolkit
     */
    @Override
    public D getToolkitDescription() {
        return toolkitDescription;
    }


    public abstract I createInputDataTransofrmer();

    public abstract R createResultTransformer();

    public abstract D createToolkitDescription();
}
